package com.example.utils;

import java.util.Collection;
import java.util.Map;

/**
 * TODO
 * 字符串判断
 * @Comment：最难的一次作业
 * @Date: 2023/12/3
 */
public class StringUtils {

    /*
    * 字符串判断
    * */
    public static boolean isNotEmpty(String str) {
        return str != null && !str.isEmpty();
    }

    /*
     * 字符串判断
     * */
    public static boolean isEmpty(String str) {
        return str == null || str.isEmpty();
    }

    /**
     * 集合判断
     */
    public static boolean isNotEmpty(Map collection) {
        return collection != null && !collection.isEmpty();
    }

    /**
     * 集合判断
     */
    public static boolean isEmpty(Map collection) {
        return collection == null || collection.isEmpty();
    }

    /**
     * 集合判断
     */
    public static boolean isNotEmpty(Collection collection) {
        return collection != null && !collection.isEmpty();
    }

    /**
     * 集合判断
     */
    public static boolean isEmpty(Collection collection) {
        return collection == null || collection.isEmpty();
    }

    /**
     * 对象判断
     */
    public static boolean isNotEmpty(Object obj) {
        return obj != null;
    }

    /**
     * 对象判断
     */
    public static boolean isEmpty(Object obj) {
        return obj == null;
    }
}
